{include file='header.html'}
<link type="text/css" href="../../page/css/reset.css" rev="stylesheet" rel="stylesheet">
<link type="text/css" href="../../page/css/work_day_set.css" rev="stylesheet" rel="stylesheet">
<link type="text/css" href="{$common_domain}/tools/datepicker/jquery.ui.theme.css" rel="stylesheet" />
<link type="text/css" href="{$common_domain}/tools/datepicker/jquery.ui.datepicker.css" rel="stylesheet" />
<link type="text/css" href="{$common_domain}/tools/datepicker/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
<script type="text/javascript" src="{$common_domain}/tools/datepicker/jquery-1.7.2.js"></script>
<script type="text/javascript" src="{$common_domain}/tools/datepicker/jquery.ui.core.js"></script>
<script type="text/javascript" src="{$common_domain}/tools/datepicker/jquery.ui.widget.js"></script>
<script type="text/javascript" src="{$common_domain}/tools/datepicker/datepick.ui.my.js"></script>
<script type="text/javascript" src="{$common_domain}/tools/datepicker/DateTimePicker.js"></script>
<script type="text/javascript">
$(function () {
        $("#s_date").datetimepicker({
            onSelect: function(){

            }
        });
    });
    function on_change(){
        var n_w = $('input[name="is_work_day"]:checked').val();
        if(n_w == 0){
            $('#is_org_holiday').show();
            $('#start_end_time').hide();
            $('#reason').show();
        }else{
            $('#is_org_holiday').hide();
            $('#start_end_time').show();
            $('#reason').hide();
            $('input[name="reason"]').val('');
            $('input:checkbox').attr('checked',false);
        }
    }
    function check_time($type){
       var start = $('#start_time').val();
       var end   = $('#end_time').val();
       var st = parseInt(start.substr(0,2));
       var en = parseInt(end.substr(0,2));
       if(st >= en){
          alert('上班时间应小于下班时间');
          if($type==1){
            $('#start_time').val('09:00');
          }else if($type==2){
            $('#end_time').val('18:00');
          }
       }
    }
    function do_submit(){
        if($('#s_date').val()==''){
            alert('选择日期');
            return false;
        }
        var n_w = $('input[name="is_work_day"]:checked').val();
        if(n_w == 0 && $('input[name="reason"]').val()==''){
            alert('填写原因');
            return false;
        }
           return true;
    }
</script>
<div id="content">
    <i class="con_l">&nbsp;</i>
    <i class="con_r">&nbsp;</i>
    <div class="titname">
        <a href="/manage/">权限管理</a>
        <a href="/workdayadd/" class="selected">工作日管理</a>
    </div>
    <div class="main">
        <div class="blank"></div>
        <div class="workManage">
            <a class="workDiary" href="/workday/" target="_blank">工作日管理日志</a>
            <form action="" onsubmit="return do_submit()" method="post">
            <ul>
                <li>
                    <div class="top text">将<input id = "s_date"  name="s_date" readonly = "readonly" type="text" class="jko1 notime" /></div>
                <li>
                <li>
                    <div class="text">设置为：<input id="is_work_day" name="is_work_day" type="radio" value="1" checked="checked" onclick="on_change()"><i class="work">工作日</i><input id="not_work_day" name="is_work_day" type="radio" style="margin-left: 35px;" value="0" onclick="on_change()"><i class="work">非工作日</i><span id="is_org_holiday" style="display:none;"><input name="is_org_holiday" type="checkbox" style="margin-left: 25px;"><i class="work">带薪</i></span></div>
                </li>
                <li>
                    <div class="text" id="start_end_time">上下班时间为：
                    <select class="selectStyle" id="start_time" name="start_time" onchange="check_time(1)">
                    <option value="09:00">09:00</option>
                    <option value="10:00">10:00</option>
                    <option value="11:00">11:00</option>
                    <option value="12:00">12:00</option>
                    <option value="13:00">13:00</option>
                    <option value="14:00">14:00</option>
                    <option value="15:00">15:00</option>
                    <option value="16:00">16:00</option>
                    <option value="17:00">17:00</option>
                    </select>&nbsp;-&nbsp;
                    <select class="selectStyle" id="end_time" name="end_time" onchange="check_time(2)">
                    <option value="10:00">10:00</option>
                    <option value="11:00">11:00</option>
                    <option value="12:00">12:00</option>
                    <option value="13:00">13:00</option>
                    <option value="14:00">14:00</option>
                    <option value="15:00">15:00</option>
                    <option value="16:00">16:00</option>
                    <option value="17:00">17:00</option>
                    <option value="18:00" selected="selected">18:00</option>
                    </select>
                    </div>
                    <div class="text" id="reason" style="display:none;">原因：<input name="reason"></div>
                </li>
                <li><input type="submit" class="lgo" value="保&nbsp;&nbsp;&nbsp;&nbsp;存"></li>
            </ul>
            </form>
        </div>
    </div>
</div>